<template>
    <div class="mall-body">
        <div class="mall-list">
            <div class="mall-item" v-for="item in mallList" :key="item.impId" @click="$router.push(`/mall/MallDetails/${item.impId}`)">
                <div class="mall-img"><van-image fit="cover" width="100%" height="100%" :src="appUrl + item.impPic"/></div>
                <div class="mall-info">
                    <div>{{ item.impName }}</div>
                    <div>
                        <i class="iconfont icon-jifen" style="font-size: 14px"></i>
                        <span>{{item.impExchange}}</span>
                    </div>
                </div>
            </div>
        </div>
        <div v-if="mallList.length === 0" :style="{'height' : isHeight ? 'calc(100vh - 76px)' : ''}">
            <div class="box-table" style="width:100%;height:100%;">
                <div class="box-table-cell" style="text-align: center;">
                    <div class="no-data">
                        <img src="../../../static/images/no-data.png" alt=""/>
                        <p class="color999">{{ $t("no_data") }}</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { Image } from 'vant';
export default {
    name: 'Mall',
    props: {
        mallList: {
            type: Array,
            default() {
                return [];
            }
        },
        isNoMore: {
            type: Boolean,
            default: false
        },
        isHeight: {
            type: Boolean,
            default: false
        }
    },
    components: {
        vanImage: Image
    }
};
</script>

<style scoped lang="less">
    .mall-body {
        height: 100%;
        .mall-list {
            padding: 10px 15px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-column-gap: 10px;
            grid-row-gap: 10px;
            .mall-item {
                border-radius: 5px;
                min-width: 0;
                .mall-img {
                    height: 160px;
                    width: 100%;
                    /deep/.van-image__img, /deep/.van-image__error {
                        border-top-left-radius: 5px;
                        border-top-right-radius: 5px
                    }
                }
                .mall-info {
                    display: flex;
                    flex-direction: column;
                    height: 70px;
                    justify-content: space-between;
                    background: #fff;
                    padding: 0 10px;
                    border-bottom-left-radius: 5px;
                    border-bottom-right-radius: 5px;
                    &>div:first-child {
                        margin-top: 10px;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                    }
                    &>div:last-child {
                        margin-bottom: 10px;
                        font-size: 12px;
                        color: #A4A4A4;
                        &>span{
                            color: #666666;
                        }
                    }
                }
            }
        }
    }
</style>
